import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', {
  state: () => ({
    uid: null,
    nickename: '',
    profile: '',
    grade: 0,
    experience: 0,
  }),
  actions: {
    setUid(uid) {
      this.uid = uid
    },
    setNickename(nickename) {
      this.nickename = nickename
    },
    setProfile(profile) {
      this.profile = profile
    },
    setGrade(grade) {
      this.grade = grade
    },
    setExperience(experience) {
      this.experience = experience
    },
    reset() {
      this.uid = null
      this.nickename = ''
      this.profile = ''
      this.grade = 0
      this.experience = 0
    }
  }
})


